<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <title>运维监控系统-登录页面</title>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

    <!-- start: CSS -->
    <link th:href="@{css/bootstrap.min.css}" rel="stylesheet"/>
    <link th:href="@{css/bootstrap-responsive.min.css}" rel="stylesheet"/>
    <link th:href="@{css/style.min.css}" rel="stylesheet"/>
    <link th:href="@{css/style-responsive.min.css}" rel="stylesheet"/>
    <link th:href="@{css/login.css}" rel="stylesheet"/>
    <script th:src="@{js/jquery.min.js}"></script>

    <style>
        .agreement {
            color: #fff;
        }
    </style>

    <style>

    </style>

</head>

<body>
<div class="container-fluid-full">
    <div class="row-fluid">

        <div class="row-fluid">
            <div class="login-box">
                <h2>中交通信运维监控系统</h2>
                <form class="form-horizontal" action="" method="post"/>
                <fieldset>
                    <input class="input-large span12" name="user_tel" id="user_tel" type="text" placeholder="输入手机号"/>
                    <input class="input-large span12" name="password" id="password" type="password" placeholder="输入密码"/>
                    <button type="button" id="button" onclick="doLogin()" class="btn btn-primary span12 subform"
                            style="height:42px;">登 录
                    </button>
                </fieldset>

                <!--<h3 style="cursor:pointer" data-toggle="modal" data-target="#dealer_detail_modal">忘记密码?</h3>-->
            </div>
        </div>
        <!--/row-->

    </div>
    <!--/fluid-row-->

</div>

<script>

    function doLogin() {
        var phone = $('#user_tel').val();
        var password = $('#password').val();
        if (phone == null || phone == '') {
            alert('请输入手机号码！')
            return;
        }
        if (password == null || password == '') {
            alert('请输入密码！')
            return;
        }
        $.ajax({
            type: 'POST',
            url: '/doLogin.html',
            data: {'phone': phone, 'password': password},
            success: function (data) {
                if ("ok" == data) {
                    window.location.href = '/server-group-list';
                } else {
                    alert(data);
                }
            },
            error: function (data) {
                alert("系统异常！");
            }
        });
    }

</script>
</body>
</html>